import request from '@/utils/request'

// 查询追溯结果列表
export function listAResult(query) {
  return request({
    url: '/system/aResult/list',
    method: 'get',
    params: query
  })
}

// 查询追溯结果详细
export function getAResult(id) {
  return request({
    url: '/system/aResult/' + id,
    method: 'get'
  })
}

// 新增追溯结果
export function addAResult(data) {
  return request({
    url: '/system/aResult',
    method: 'post',
    data: data
  })
}

// 修改追溯结果
export function updateAResult(data) {
  return request({
    url: '/system/aResult',
    method: 'put',
    data: data
  })
}

// 删除追溯结果
export function delAResult(id) {
  return request({
    url: '/system/aResult/' + id,
    method: 'delete'
  })
}

// 查询追溯结果列表
export function retraceResultList(query) {
  return request({
    url: '/system/aResult/retraceResultList',
    method: 'get',
    params: query
  })
}

// 新增追溯结果
export function createResult(data) {
  return request({
    url: '/system/aResult/createResult',
    method: 'post',
    data: data
  })
}

// 查询工艺路线列表
export function routeList() {
  return request({
    url: '/system/aResult/routeList',
    method: 'get'
  })
}

// 工单剩余数量查询
export function getWorkOrderRestQty(workOrder) {
  return request({
    url: '/system/aResult/getWorkOrderRestQty?workOrder=' + workOrder,
    method: 'get'
  })
}